import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';


import { AppComponent } from './app.component';
import { TextFristComponent } from './text-frist/text-frist.component';
import { TextSecondComponent } from './text-second/text-second.component';
import {RouterModule, Routes} from '@angular/router';
import { TextThirdComponent } from './text-third/text-third.component';

const rootRoutes: Routes = [
  {path: '', redirectTo: 'textFrist', pathMatch: 'full'},
  {path: 'textFrist/:name', component: TextFristComponent},
  {path: 'textSecond', component: TextSecondComponent},
  {path: 'textThird', component: TextThirdComponent},
  {path: '**', redirectTo: 'textFrist', pathMatch: 'full'}
];

@NgModule({
  declarations: [
    AppComponent,
    TextFristComponent,
    TextSecondComponent,
    TextThirdComponent
  ],
  imports: [
    BrowserModule,
    RouterModule.forRoot(rootRoutes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
